// 清除浮动
@mixin clearfix() {
  &:after {
    content: '';
    display: block;
    visibility: hidden;
    clear: both;
  }
}
// 单行超出隐藏
@mixin text-ellipsis($width: 100px) {
  width: $width;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
// 多行文本超出隐藏
@mixin text-ellipsis-mul($row: 3) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $row;
  -webkit-box-orient: vertical;
}
// 定位居中
@mixin center-absolute($width, $height) {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -($width / 2);
  margin-top: -($height / 2);
  width: $width;
  height: $height;
}
// css3居中
@mixin center-transform() {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
}
// flex居中
@mixin flex-center() {
  display: flex;
  align-items: center;
  justify-content: center;
}
//设置透明度
@mixin opacity($val) {
  filter: alpha(opacity= $val);
  opacity: $val / 100;
}
// 向上实心三角心
@mixin triangle($color: black, $width: 3px, $height: 3px) {
  position: relative;
  &:after {
    content: '';
    display: inline-block;
    border-bottom: $width solid $color;
    border-right: $height solid transparent;
    border-left: $height solid transparent;
  }
}

// 列表箭头
@mixin item-arrow($color: #999, $width: 5px) {
  position: relative;
  &:after {
    content: '';
    display: block;
    width: $width;
    height: $width;
    border-top: 1px solid $color;
    border-right: 1px solid $color;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
  }
}
